HTMLify
style.css
Views: 16 | Author: cody
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | * { margin: 0; padding: 0; box-sizing: border-box; } body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: #282A36; } .navigation { position: relative; width: 400px; height: 60px; background: white; display: flex; justify-content: center; align-items: center; border-radius: 10px; } .navigation ul { width: 350px; display: flex; } .navigation ul li { list-style: none; position: relative; width: 70px; /* ul: width 350 / 5 = 70 */ height: 60px; z-index: 2; } .navigation ul li a { text-decoration: none; color:#555; position: relative; display: flex; justify-content: center; align-items: center; width: 100%; height: 100%; } .navigation ul li a .icon { position:relative; background: #fff; display:block; width: 55px; height: 55px; text-align: center; line-height: 65px; border-radius: 65px; color: #222327; font-size: 1.5em; transition: 0.5s; transition-delay: 0s; } .navigation ul li.active a .icon { background: var(--clr); color: #fff; transform: translatey(-27px); transition-delay: 0.25s; } .navigation ul li a .icon:before { content: ''; position: absolute; top: 10px; left: 0; width: 100%; height: 100%; background: var(--clr); border-radius: 50%; filter: blur(5px); opacity:0; transition: .5s; transition-delay: 0.15s; } .navigation ul li.active a .icon:before { opacity: 0.5; transition-delay: 0.25s; } .indicator { position: absolute; top: -35px; width: 70px; height: 70px; background: #fff; border-radius: 50%; z-index: 1; transition: 0.5s; } .indicator::before { content: ''; position: absolute; top: 5px; left: -27.5px; width: 30px; height: 30px; border-radius: 50%; box-shadow: 15px 18px #fff } .indicator::after { content: ''; position: absolute; top: 5px; right: -27.5px; width: 30px; height: 30px; border-radius: 50%; box-shadow: -15px 18px #fff } .navigation ul li:nth-child(1).active ~ .indicator { transform: translatex(calc(70px * 0)); } .navigation ul li:nth-child(2).active ~ .indicator { transform: translatex(calc(70px * 1)); } .navigation ul li:nth-child(3).active ~ .indicator { transform: translatex(calc(70px * 2)); } .navigation ul li:nth-child(4).active ~ .indicator { transform: translatex(calc(70px * 3)); } .navigation ul li:nth-child(5).active ~ .indicator { transform: translatex(calc(70px * 4)); } |